import { withModifiers, defineComponent, ref, h, reactive } from 'vue'
const Child = defineComponent({
  props: ['msg'],
  emits: ['update:msg'],
  slots: ['header', 'body', 'footer'],
  setup(props, { attrs, expose, slots, emit }) {
    // 最后返回的数据 todo 返回的数据一定要通过函数来返回
    return () => (
      <>
        <input
          value={props.msg}
          onInput={(event: any) => {
            emit('update:msg', event?.target?.value)
          }}
        ></input>
        我是儿子
        <div class="header">{slots.default && slots.default()}</div>
        <div class="body">{slots.header && slots.header()}</div>
        <div class="footer">{slots.body && slots.body()}</div>
      </>
    )
  },
})

export default Child
